const mongoose = require('mongoose')
const {dbHost} =require('../../conf/index')
const { generateId } = require('../../utils/index')

const connection = mongoose.createConnection(`mongodb://${dbHost}/manage_db`)

const Schema = mongoose.Schema

const carouselSchema = new Schema({
  carouselNo: {
    type: String,
    default() {
      return generateId('LB')
    }
  },
  list:{type:Array,default:[]},
  duration: { type: Number, default: 3 } // 收藏量
})

module.exports = connection.model('carousel', carouselSchema)
